package com.ruibang.glass.portal.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-10-18  16:21
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@TableName("t_sys_new_menu")
public class NewMenu extends BaseEntity implements Serializable {

    @TableId(value = "menu_id")
    @ApiModelProperty(value = "菜单ID")
    private String menuId;

    @ApiModelProperty(value = "路由路径")
    private String path;

    @ApiModelProperty(value = "路由名称")
    private String name;

    @ApiModelProperty(value = "布局方式")
    private String component;

    @ApiModelProperty(value = "父ID")
    @NotBlank(message = "父级id不可为空(0为顶级)")
    private String parentId;

    @ApiModelProperty(value = "0:目录 1:菜单 2:按钮")
    @NotBlank(message = "菜单类型不可为空")
    private String type;

    @ApiModelProperty(value = "元数据JSON")
    @JsonIgnore
    private String metaJson;

    @ApiModelProperty(value = "权限标识")
    private String ident;

    @ApiModelProperty(value = "元数据")
    @TableField(exist = false)
    private Meta meta;

    @ApiModelProperty(value = "按钮")
    @TableField(exist = false)
    private List<NewMenu> btns;

    @ApiModelProperty(value = "子级")
    @TableField(exist = false)
    private List<NewMenu> children;
}
